package photobox.manage

import grails.converters.JSON

class MngHomeController {
    def administratorService
    def index() {}
    def login() {}
    def loginCheck(){
        def r = administratorService.loginCheck(params,session)
        if(r){
            render([status: 1, message: "登录成功",uid: r] as JSON)
        }else{
            render([status: 0, message: "用户名密码错误 "] as JSON)
        }

    }
    def adminQuit(){
        //session.invalidate()
        session.removeAttribute("user");
        redirect(controller: 'mngHome', action: 'index')
    }
}
